﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>SpanItemView</title>
    <link href="~/layui/css/layui.css" rel="stylesheet" />
</head>
<body>
    <div style="width:800px">
        <form class="layui-form" action="/Invoice/UpdateInvoice">
        <input type="text" hidden id="Id" name="Id" value="" />
      <div class="layui-form-item">
        <label class="layui-form-label">单位</label>
        <div class="layui-input-block">
          <input type="text" disabled id="InvoicingOffice" name="InvoicingOffice" required  lay-verify="required" placeholder="请输入单位" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">发票类型</label>
        <div class="layui-input-block">
		  <input type="radio" disabled name="InvoiceType" value="普通发票" title="普通发票">
		  <input type="radio" disabled name="InvoiceType" value="增值税专用发票" title="增值税专用发票">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >发票金额</label>
        <div class="layui-input-block">
          <input type="text" disabled id="InvoicePrice" name="InvoicePrice" required  lay-verify="required" placeholder="请输入发票金额" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label" >税率</label>
        <div class="layui-input-block">
          <input type="text" disabled name="taxRate" id="taxRate" required  lay-verify="required" placeholder="请输入税率" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item">
        <label class="layui-form-label">开票日期</label>
        <div class="layui-input-block">
          <input type="date" disabled name="InvoiceTime" id="InvoiceTime" required  lay-verify="required" placeholder="请输入开票日期" autocomplete="off" class="layui-input">
        </div>
      </div>
      <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">备  注</label>
        <div class="layui-input-block">
          <textarea id="Remarks" disabled name="Remarks" placeholder="请输入备注" class="layui-textarea"></textarea>
        </div>
      </div>
      <div class="layui-form-item">
        <div class="layui-input-block">
          <button class="layui-btn" type="submit" lay-submit >立即提交</button>
          <button type="reset" class="layui-btn layui-btn-primary" onclick="fh()">返回</button>
        </div>
      </div>
        </form>
    </div>
	<link href="~/Content/bootstrap.css" rel="stylesheet" />
	<link href="~/layer/skin/layer.css" rel="stylesheet" />
	<script src="~/Scripts/jquery-3.4.1.min.js"></script>
	<script src="~/layui/layui.js"></script>
    <script>
    //Demo
    $(function(){
        //文档就绪函数
        GetById();
    })
    layui.use('form', function(){
      var form = layui.form;
      form.render();
      //监听提交

      form.on('submit(formDemo)', function(data){
      });
    });
    function fh(){
        window.parent.location.reload();
        var index = parent.layer.getFrameIndex(window.name);parent.layer.close(index);
    }

        var id = @ViewBag.id;
        
            function GetById()
            {
                $.ajax({
                    url:"/Invoice/GetAsyncc?id="+id,
                    type:"get",
                    dataType:"json",
                    success:function(obj){
                        console.info(obj);
                        $("#Id").val(obj.id);
                        $("#InvoicingOffice").val(obj.invoicingOffice);
                        $("[name=InvoiceType][value="+obj.invoiceType+"]").prop("checked",true);
                        $("#InvoicePrice").val(obj.invoicePrice);
                        $("#taxRate").val(obj.taxRate);
                        $("#InvoiceTime").val(obj.invoiceTime);
                        $("#Remarks").val(obj.remarks);
                    }
                })
            }

    </script>
</body>
</html>
